bitkeeper revision 1.535 (3f9ed8a2fZBk0CjxQTZazTwxPVGVjQ)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 28 Oct 2003 20:59:14 +0000 (20:59 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 28 Oct 2003 20:59:14 +0000 (20:59 +0000)
xeno.c, xl_block.c:
  Make Xenolinux a bit noisier on blkdev errors. Properly mark read-only partitions as such, to avoid disappearing files.

xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c
xenolinux-2.4.22-sparse/fs/partitions/xeno.c

index 357c2056a601625c249dd9ee56ae096e474d13e3..2592b88ec39766dbc110e29231a22137e2def0f5 100644 (file)
@@ -495,8 +495,8 @@ static void xlblk_response_int(int irq, void *dev_id, struct pt_regs *ptregs)
         case XEN_BLOCK_READ:
         case XEN_BLOCK_WRITE:
             if ( bret->status )
-                DPRINTK("Bad return from blkdev data request: %lx\n",
-                        bret->status);
+                printk("Bad return from blkdev data request: %lx\n",
+                       bret->status);
             for ( bh = (struct buffer_head *)bret->id; 
                   bh != NULL; 
                   bh = next_bh )
index 98cd08d65af6e51d6cb3366dd27906c53f4183b9..e60fc76b5a118917c72da02be992fc36008ce8ab 100644 (file)
@@ -24,7 +24,7 @@ int xeno_partition(struct gendisk *hd,
     int i, minor;
     
     /* Privileged domains can read partition info themselves. */
-    if (start_info.flags & SIF_PRIVILEGED)
+    if ( start_info.flags & SIF_PRIVILEGED )
         return 0;
 
     /* This only deals with raw/direct devices (IDE & SCSI). */
@@ -56,6 +56,13 @@ int xeno_partition(struct gendisk *hd,
         if ( (buf->entries[i].device == xldev_to_physdev(bdev->bd_dev)) &&
              (buf->entries[i].partition == 0) )
         {
+            if ( !(buf->entries[i].mode & PHYSDISK_MODE_W) )
+            {
+                if ( !(buf->entries[i].mode & PHYSDISK_MODE_R) )
+                    continue;
+                for ( i = 0; i < hd->max_p; i++ ) 
+                    set_device_ro(bdev->bd_dev + i, 1);
+            }
             kfree(buf);
             return 0;
         }
@@ -66,11 +73,11 @@ int xeno_partition(struct gendisk *hd,
     {
         if (buf->entries[i].device != xldev_to_physdev(bdev->bd_dev))
             continue;
-        if (!(buf->entries[i].mode & PHYSDISK_MODE_W))
+        if ( !(buf->entries[i].mode & PHYSDISK_MODE_W) )
         {
-            if (!(buf->entries[i].mode & PHYSDISK_MODE_R))
+            if ( !(buf->entries[i].mode & PHYSDISK_MODE_R) )
                 continue;
-            set_device_ro(bdev->bd_dev, 1);
+            set_device_ro(bdev->bd_dev + buf->entries[i].partition, 1);
         }
         minor = buf->entries[i].partition + first_part_minor - 1;
         add_gd_partition(hd,